package com.analyse.stock.constant;

public class ApiConstant {
    public static final String BEGIN_DATE = "2000-01-01";
    // 沧海数据tsanghi 用户token
    public static final String TSANGHI_TOKEN = "8219e95b4a224aaf95a45b83077e2df1";

    // 东方财富网用户token
    public static final String EASYMONEY_TOKEN = "fa5fd1943c7b386f172d6893dbfba10b";
    public static final String EASYMONEY_APPKEY  ="e9166c7e9cdfad3aa3fd7d93b757e9b1";
    // 东方财富网用户URL
    public static final String EASYMONEY_API = "https://tsanghi.com/api";

    /**
     * 新建分组-东方财富网
     **/
    public static final String CREATE_GROUP_URL = "https://myfavor.eastmoney.com/v4/webouter/ag?appkey="+EASYMONEY_APPKEY+"&gn={}&_={}";
    //https://myfavor.eastmoney.com/v4/webouter/as?appkey=e9166c7e9cdfad3aa3fd7d93b757e9b1&cb=jQuery37106396736055598369_1732514886155&g=36&sc=1%24600600&_=1732514886249
    public static final String ADD_STOCK_TO_GROUP_URL = "https://myfavor.eastmoney.com/v4/webouter/as?appkey="+EASYMONEY_APPKEY+"&g={}&sc={}&_={}";
    //https://myfavor.eastmoney.com/v4/webouter/ds?appkey=e9166c7e9cdfad3aa3fd7d93b757e9b1&cb=jQuery37106396736055598369_1732514886157&g=36&sc=0%24000722&_=1732514886289
    public static final String DEL_STOCK_GROUP_URL = "https://myfavor.eastmoney.com/v4/webouter/ds?appkey="+EASYMONEY_APPKEY+"&g={}&sc={}&_={}";

    /**
     *  股票得财务数据--东方财富网
     * */
    public static final String STOCK_FUND_URL = "https://98.push2.eastmoney.com/api/qt/ulist/sse?secids={}&fields=f12,f13,f14,f19,f139,f148,f2,f4,f1,f125,f18,f3,f152,f221,f38,f39,f36,f112,f113,f37,f40,f41,f42,f43,f44,f45,f46,f47,f48,f49,f50,f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f26&invt=3&ut="+EASYMONEY_TOKEN+"&fid=&po=1&pi=0&pz=63&mpi=6000&dect=1";
    /**
     * 获取股票的 流通市值(元)，总市值(元)--东方财富网
     * 最新股价
     * {"rc":0,"rt":4,"svr":177617627,"lt":1,"full":1,"dlmkts":"","data":{"f43":10763,"f44":11165,"f45":10715,"f46":11001,"f47":205440,"f48":2245189059.0,"f49":95885,"f50":64,"f51":12136,"f52":9930,"f55":1.955899644,"f57":"603501","f58":"韦尔股份","f59":2,"f60":11033,"f71":10929,"f84":1214427012.0,"f85":1214427012.0,"f86":1731658304,"f92":18.4626044,"f107":1,"f108":2.110057346,"f111":2,"f116":130708779301.56,"f117":130708779301.56,"f120":-233,"f121":1554,"f122":99,"f135":910071120.0,"f136":1006077792.0,"f152":2,"f161":109555,"f162":4127,"f163":23525,"f164":5101,"f167":583,"f168":169,"f169":-270,"f170":-245,"f171":408,"f174":12400,"f175":7580,"f177":131649,"f191":-8222,"f192":-1485,"f256":"-","f257":0,"f260":"-","f261":"-","f262":"113616","f269":"-","f270":0,"f277":1214427012.0,"f278":41600000.0,"f279":1,"f285":"-","f286":0,"f288":0,"f292":5,"f294":0,"f295":"-","f301":10763,"f31":10768,"f32":35,"f33":10766,"f34":1313,"f35":10765,"f36":224,"f37":10764,"f38":69,"f39":10763,"f40":5,"f19":10762,"f20":16,"f17":10761,"f18":21,"f15":10760,"f16":56,"f13":10759,"f14":4,"f11":10758,"f12":64,"f734":""}}
     * */
    public static final String STOCK_MV_URL = "https://push2.eastmoney.com/api/qt/stock/get?invt=2&fltt=1&fields=f189,f26,f58,f734,f107,f57,f43,f59,f169,f170,f152,f177,f111,f46,f60,f44,f45,f47,f260,f48,f261,f279,f277,f278,f288,f19,f17,f531,f15,f13,f11,f20,f18,f16,f14,f12,f39,f37,f35,f33,f31,f40,f38,f36,f34,f32,f211,f212,f213,f214,f215,f210,f209,f208,f207,f206,f161,f49,f171,f50,f86,f84,f85,f168,f108,f116,f167,f164,f162,f163,f92,f71,f117,f292,f51,f52,f191,f192,f262,f294,f295,f269,f270,f256,f257,f285,f286,f120,f121,f122,f55,f174,f175,f135,f136,f301&secid={}&ut="+EASYMONEY_TOKEN +"&wbp2u=4322014617292454|0|1|0|web&dect=1&_={}";
    /**
     * 最新股价
     * 服务器推送
     **/
    public static final String STOCK_REAL_TIME_URL = "https://79.push2.eastmoney.com/api/qt/stock/sse?fields=f58,f734,f107,f57,f43,f59,f169,f170,f152,f177,f111,f46,f60,f44,f45,f47,f260,f48,f261,f279,f277,f278,f288,f19,f17,f531,f15,f13,f11,f20,f18,f16,f14,f12,f39,f37,f35,f33,f31,f40,f38,f36,f34,f32,f211,f212,f213,f214,f215,f210,f209,f208,f207,f206,f161,f49,f171,f50,f86,f84,f85,f168,f108,f116,f167,f164,f162,f163,f92,f71,f117,f292,f51,f52,f191,f192,f262,f294,f295,f269,f270,f256,f257,f285,f286,f120,f121,f122,f55,f174,f175,f135,f136,f301&mpi=1000&invt=2&fltt=1&secid=1.603906&ut=fa5fd1943c7b386f172d6893dbfba10b&dect=1&wbp2u=4322014617292454|0|1|0|web";

    /**
     * 股票历史资金流向--东方财富网
     */
    public static final String FUND_FLOW_URL = "https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get?lmt={}&secid={}&klt=101&fields1=f1,f2,f3,f7&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64,f65&ut="+EASYMONEY_TOKEN+"&_={}";
    /**
     * 获取股票当日实时的资金流向--东方财富网--分时
     */
    public static final String FUND_FLOW_REAL_TIME_URL = "https://push2.eastmoney.com/api/qt/stock/fflow/kline/get?lmt=0&klt=1&fields1=f1%2Cf2%2Cf3%2Cf7%2Cf48&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf58%2Cf59%2Cf60%2Cf61%2Cf62%2Cf63%2Cf64%2Cf65&ut="+EASYMONEY_TOKEN+"&secid={}&_={}";
    public static final String FUND_FLOW_REAL_TIME_VOL_URL = "https://push2.eastmoney.com/api/qt/stock/get?fltt=2&invt=2&secid={}&fields=f57%2Cf58%2Cf43%2Cf47%2Cf48%2Cf168%2Cf169%2Cf170%2Cf152&ut="+EASYMONEY_TOKEN+"&_={}";
    /**
     * 获取股票当日实时的资金流向--实时统计数据--东方财富网
     */
    public static final String REAL_TIME_FUND_FLOW_STAT_URL = "https://push2.eastmoney.com/api/qt/ulist.np/get?fltt=2&secids={}&fields=f383,f2,f3,f5,f6,f8,f12,f14,f62,f68,f184,f66,f69,f72,f75,f78,f81,f84,f87,f64,f65,f70,f71,f76,f77,f82,f83,f164,f166,f168,f170,f172,f252,f253,f254,f255,f256,f124,f278,f279,f280,f281,f282&ut="+EASYMONEY_TOKEN+"&_={}";

    /**
     * 沪深京股票 --东方财富网
     * 概念板块 fs=m:90+t:3+f:!50
     * 地域板块 fs=m:90+t:1+f:!50
     * 行业板块 fs=m:90+t:2+f:!50
     */
    public static final String BOARD_URL = "https://72.push2.eastmoney.com/api/qt/clist/get?pn=1&pz=1000&po=1&np=1&ut="+EASYMONEY_TOKEN+"&fltt=2&invt=2&dect=1&wbp2u=4322014617292454|0|1|0|web&fid=f3&fs={}&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152,f124,f107,f104,f105,f140,f141,f207,f208,f209,f222&_={}";
    //获取对应板块/指数 的详情
    public static final String BOARD_INDEX_DAILY_URL = "https://push2.eastmoney.com/api/qt/stock/get?ut="+EASYMONEY_TOKEN+"&fields=f57,f58,f106,f59,f43,f46,f60,f44,f45,f47,f48,f49,f113,f114,f115,f117,f85,f50,f119,f120,f121,f122,f135,f136,f137,f138,f139,f140,f141,f142,f143,f144,f145,f146,f147,f148,f149,f168,f169,f170&secid={}&_={}";

    //个股的板块（地域板块，行业板块，题材）
    public static final String STOCK_BOARD_URL = "https://datacenter.eastmoney.com/securities/api/data/get?type=RPT_F10_CORETHEME_BOARDTYPE&sty=BOARD_CODE,BOARD_NAME,BOARD_TYPE&filter=(SECUCODE=%22{}%22)&p=1&ps=&sr=1&st=BOARD_RANK&source=HSF10&client=PC";

    //个股所属的概念板块
    public static final String STOCK_CONCEPT_BOARD_URL = "https://datacenter.eastmoney.com/securities/api/data/v1/get?reportName=RPT_F10_CORETHEME_BOARDTYPE&columns=NEW_BOARD_CODE,BOARD_NAME&filter=(SECUCODE%3D%22{}%22)(IS_PRECISE%3D%221%22)&pageNumber=1&pageSize=&sortTypes=1&sortColumns=BOARD_RANK&source=HSF10&client=PC";

    /**
     * 获取各市场的系列指数
     * 深证系列指数 m:0+t:5
     * 上证系列指数 m:1+s:2
     * 中证系列指数 m:2
     */
    public static final String EASYMONEY_INDEX_LIST_URL = "https://62.push2.eastmoney.com/api/qt/clist/get?pn=1&pz=1000&po=1&np=1&ut="+EASYMONEY_TOKEN+"&fltt=2&invt=2&dect=1&wbp2u=4322014617292454|0|1|0|web&fid=f3&fs={}&fields=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f26,f22,f33,f11,f62,f128,f136,f115,f152&_={}";

    /**
     * 某一股票的日周月K数据--东方财富网
     * 日K   klt=101
     * 周K   klt=102
     * 月K   klt=103
     */
    public static final String KLINE_URL="https://push2his.eastmoney.com/api/qt/stock/kline/get?fields1=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61&beg={}&end={}&ut="+EASYMONEY_TOKEN+"&rtntype=6&secid={}&klt={}&fqt=1&_={}";
    /**
     * 某一股票的分时数据--东方财富网
     */
    public static final String TIME_TREND_URL="https://push2his.eastmoney.com/api/qt/stock/trends2/get?fields1=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13&fields2=f51,f52,f53,f54,f55,f56,f57,f58&ut="+EASYMONEY_TOKEN+"&secid={}&ndays=1&iscr=0&iscca=0";


    /**
     *  交易所清单--沧海数据tsanghi
     * */
    public static final String EXCHANGE_URL = "https://tsanghi.com/api/fin/stock/exchange?token="+TSANGHI_TOKEN+"&fmt=json";
    /**
     *  股票清单--沧海数据tsanghi
     * */
    public static final String STOCK_LIST_URL ="https://tsanghi.com/api/fin/stock/{}/list?token="+TSANGHI_TOKEN+"&fmt=json";
    /**
     * 某一股票的日K数据--沧海数据tsanghi
     * 接口说明：指定交易所和股票代码，获取该只股票的日线基本行情（开、高、低、收、量）。默认返回全部历史数据，也可以使用参数start_date和end_date选择特定时间段。此接口可方便地获取全球股票的历史行情，可用于数据初始化。目前，已经覆盖全球30+国家/地区，40+交易所，以及30年以上的历史数据，收录的股票数量超100000只（详见股票清单接口）。
     */
    public static final String KLINE_TSANGHI_DAY_URL= EASYMONEY_API+"/fin/stock/{}/daily?token="+TSANGHI_TOKEN+"&ticker={}&columns=amount,pre_close&start_date={}&end_date={}&fmt=json&order=1";
    /**
     * 某一股票周K数据--沧海数据tsanghi
     * 接口说明：指定交易所和股票代码，获取该只股票的周线基本行情（开、高、低、收、量）。默认返回全部历史数据，也可以使用参数start_date和end_date选择特定时间段。此接口可方便地获取全球股票的历史行情，可用于数据初始化。目前，已经覆盖全球30+国家/地区，40+交易所，以及30年以上的历史数据，收录的股票数量超100000只（详见股票清单接口）。
     */
    public static final String KLINE_TSANGHI_WEEK_URL= EASYMONEY_API+"/fin/stock/{}/weekly?token="+TSANGHI_TOKEN+"&ticker={}&columns=amount,pre_close&start_date={}&end_date={}&fmt=json&order=1";
    /**
     * 某一股票月K数据--沧海数据tsanghi
     * 指定交易所和股票代码，获取该只股票的月线基本行情（开、高、低、收、量）。默认返回全部历史数据，也可以使用参数start_date和end_date选择特定时间段。此接口可方便地获取全球股票的历史行情，可用于数据初始化。目前，已经覆盖全球30+国家/地区，40+交易所，以及30年以上的历史数据，收录的股票数量超100000只（详见股票清单接口）。
     */
    public static final String KLINE_TSANGHI_MONTH_URL= EASYMONEY_API+"/fin/stock/{}/monthly?token="+TSANGHI_TOKEN+"&ticker={}&columns=amount,pre_close&start_date=2000-01-01&end_date=2100-12-31&fmt=json&order=1";
    /**
     * 某一股票 year K数据--沧海数据tsanghi
     * 指定交易所和日期，获取全部股票的年线基本行情（开、高、低、收、量）。不指定日期时，默认返回最新行情。此接口可方便地获取每年增量行情。
     * */
    public static final String KLINE_TSANGHI_YEAR_URL= EASYMONEY_API+"/fin/stock/{}/yearly?token="+TSANGHI_TOKEN+"&ticker={}&columns=amount,pre_close&start_date=2000-01-01&end_date=2100-12-31&fmt=json&order=1";
    /**
     * 国家/地区清单
     * 获取股票已覆盖的国家/地区清单。目前，已经覆盖全球30+国家/地区。
     **/
    public static final String STOCK_COUNTRY_URL = EASYMONEY_API+"/fin/stock/country?token="+TSANGHI_TOKEN;
    public static final String INDEX_COUNTRY_URL = EASYMONEY_API+"/fin/index/country?token="+TSANGHI_TOKEN;

    /**
     * 指定国家或地区，获取相应的指数清单。目前，已经覆盖全球30+国家/地区，收录的指数数量超500只。
     **/
    public static final String INDEX_LIST_URL = EASYMONEY_API+ "/fin/index/{}/list?token="+TSANGHI_TOKEN;
}
